<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: liangliang
  Date: 2018/6/29
  Time: 15:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>DataBinding</title>
</head>
<body>
<h2>DataBinding</h2>
<c:if test="${!empty userdata}">
    <h2>数据: </h2>
    <ul>
        <li>user.name: ${userdata.username}</li>
        <li>user.age: ${userdata.age}</li>
        <li>user.address: ${userdata.address.city}</li>
    </ul>
</c:if>
<c:if test="${empty userdata}">
    <form action="/springmvc/databinding" method="post">
        <%-- username-age-address --%>
        <input type="text" name="user" value="admin-18-BJ">
        <input value="提交" type="submit">
    </form>
</c:if>

</body>
</html>
